package org.jeecg.modules.quartz.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.quartz.entity.QuartzJob;
import org.quartz.SchedulerException;

import java.util.List;

/**
 * @Description: 定时任务在线管理
 * @Author: jeecg-boot
 * @Date: 2019-04-28
 * @Version: V1.1
 */
public interface IQuartzJobService extends IService<QuartzJob> {

    /**
     * findByJobClassName
     *
     * @param jobClassName
     * @return
     */
    List<QuartzJob> findByJobClassName(String jobClassName);

    /**
     * saveAndScheduleJob
     *
     * @param quartzJob
     * @return
     */
    boolean saveAndScheduleJob(QuartzJob quartzJob);

    /**
     * editAndScheduleJob
     *
     * @param quartzJob
     * @return
     * @throws SchedulerException
     */
    boolean editAndScheduleJob(QuartzJob quartzJob) throws SchedulerException;

    /**
     * deleteAndStopJob
     *
     * @param quartzJob
     * @return
     */
    boolean deleteAndStopJob(QuartzJob quartzJob);

    /**
     * resumeJob
     *
     * @param quartzJob
     * @return
     */
    boolean resumeJob(QuartzJob quartzJob);
}
